package itheima.com.tabhostdemo;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import static android.os.Build.VERSION_CODES.M;

/**
 *底部tab枚举
 */
public enum  MainTab {
    //声明枚举对象
    TAB_NEWS("news","综合",DefaultFragment.class),
    TAB_TWEETS("tweets","动弹",DefaultFragment.class),
    TAB_FIND("find","发现",DefaultFragment.class),
    TAB_ME("me","我",DefaultFragment.class);

    private String title;//标题
    private String tag;//标记
    private Class<? extends Fragment>  clz;//关联的fragmnet

    private MainTab(String tag, String title,Class<? extends Fragment> clz ) {
        this.clz = clz;
        this.tag = tag;
        this.title = title;
    }

    public Class<? extends Fragment> getClz() {
        return clz;
    }
    public String getTag() {
        return tag;
    }
    public String getTitle() {
        return title;
    }
}


/*//创建一个私有构造函数的类
 class  MainTabClass {
    //声明枚举对象
//    TAB_NEWS("news","综合",DefaultFragment.class),
//    TAB_TWEETS("tweets","动弹",DefaultFragment.class),
//    TAB_FIND("find","发现",DefaultFragment.class);

    MainTabClass TAB_NEWS=new MainTabClass("news","综合",DefaultFragment.class);
    MainTabClass TAB_TWEETS=new MainTabClass("tweets","动弹",DefaultFragment.class);
    MainTabClass TAB_FIND=new MainTabClass("find","发现",DefaultFragment.class);

    private String title;//标题
    private String tag;//标记
    private Class<? extends Fragment>  clz;//关联的fragmnet

    private MainTabClass(String tag, String title,Class<? extends Fragment> clz ) {
        this.clz = clz;
        this.tag = tag;
        this.title = title;
    }

    public Class<? extends Fragment> getClz() {
        return clz;
    }
    public String getTag() {
        return tag;
    }
    public String getTitle() {
        return title;
    }
}*/

